function [output subjectinfo] = calculateTfcData (subjectinfo, cfg)
tStart = tic;
output = [];
fnES = fieldnames(subjectinfo.EpochData);
for i = 1:length(fnES)
    currentEpochset = fnES{i};    
    fnEL = fieldnames(subjectinfo.EpochData.(currentEpochset).TfcData);
    listOfTfcDataFiles = cell(1,length(fnEL));
    for j = 1:length(fnEL)
        currentElectrode = fnEL{j};
        listOfTfcDataFiles{j} = subjectinfo.EpochData.(currentEpochset).TfcData.(currentElectrode).Filename;
    end
    % [oooo subjectinfo] = calculateTfcDataPerEpochset(output, subjectinfo, currentEpochset, listOfTfcDataFiles);
    cfg = calculateTfcData_defaultCfg();
    cfg.SubjectPrimaryPrefix = subjectinfo.PrimaryPrefix;
    cfg.SubjectName = subjectinfo.Name;
    cfg.EpochSetName = 'currentEpochset';
    cfg.Input.ListOfTfcFiles = listOfTfcDataFiles;
    outputCTD = calculateTfcData_Core(cfg);
    subjectinfo.EpochData.(currentEpochset).TfcDatafile = outputCTD.TfcDatafile;
end
output.TimePassed = toc(tStart);
end